package com.evildog.workspace.system.application.convert;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.evildog.workspace.common.result.PagedResult;
import com.evildog.workspace.system.application.bo.*;
import com.evildog.workspace.system.application.dto.ApiPermissionDTO;
import com.evildog.workspace.system.application.dto.ApiPermissionPageDTO;
import com.evildog.workspace.system.application.entity.ApiPermission;
import com.evildog.workspace.system.application.entity.ApiPermissionPageDO;
import com.evildog.workspace.system.application.model.ApiPermissionPageParam;
import com.evildog.workspace.system.application.model.ApiPermissionParam;
import com.evildog.workspace.system.application.vo.ApiPermissionAllocVO;
import com.evildog.workspace.system.application.vo.ApiPermissionListVO;
import com.evildog.workspace.system.application.vo.ApiPermissionPageVO;
import com.evildog.workspace.system.application.vo.ApiPermissionVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface ApiPermissionConvert {

    ApiPermissionConvert INSTANCE = Mappers.getMapper(ApiPermissionConvert.class);

    ApiPermissionPageDTO convert(ApiPermissionPageParam apiPermissionPageParam);

    ApiPermissionDTO convert(ApiPermissionParam apiPermissionParam);

    @Mapping(target = "isDeleted", ignore = true)
    ApiPermission convert(ApiPermissionDTO apiPermissionDTO);

    ApiPermissionPageDO convert(ApiPermissionPageDTO apiPermissionPageDTO);

    ApiPermissionVO convert(ApiPermissionBO apiPermissionBO);

    ApiPermissionBO convert(ApiPermission apiPermission);

    List<ApiPermissionListVO> convertVoList(List<ApiPermissionListBO> apiPermissionListBO);

    @Mappings({})
    PagedResult<ApiPermissionPageBO> convert(IPage<ApiPermissionPageDO> page);

    PagedResult<ApiPermissionPageVO> convert(PagedResult<ApiPermissionPageBO> page);

    List<ApiPermissionClientBO> convertClientBO(List<ApiPermission> list);

    List<com.evildog.workspace.system.api.vo.ApiPermissionVO> convertFeignList(List<ApiPermissionClientBO> allPermissions);

    List<ApiPermissionAllocVO> convertAllocVoList(List<ApiPermissionAllocBO> apiPermissionListBO);

    List<ApiPermissionListBO> convertListBo(List<ApiPermission> list);
}